package com.dly.hope.workflow.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import jodd.util.StringPool;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.Objects;

/**
 * @classname: ApprRecordVO
 * @description:
 * @author: Danny Chen
 * @create: 2022-01-22 22:30
 */
@Data
@NoArgsConstructor
public class ApprRecordDTO {

    /**
     * 节点实例ID
     */
    private String nodeInstanceId;

    /**
     * 节点定义名称
     */
    private String nodeName;

    /**
     * 该节点是否审批完成
     */
    private Boolean completed;

    /**
     * 该节点审批结果
     */
    private String approvalResult;

    /**
     * 该节点审批时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date approvalDate;

    /**
     * 该节点审批意见/理由/原因
     */
    private String suggestion;

    /**
     * 节点审批备注
     */
    private String remark;

    /**
     * 节点展示序号 (序号小的排在前面，返回的List已经做过排序)
     */
    //private Integer displayNo;

    /**
     * 下一个节点实例的ID
     */
    private String nextNodeInstanceId;

    /**
     * 该节点实际审批人ID（审批动作完成后才会有）
     */
    private String approverId;

    /**
     * 该节点实际审批人的姓名
     */
    private String approverName;

    /**
     * 该节点实际审批人的工号
     */
    private String approverJobNumber;

    /**
     * 该节点实际审批人的角色ID
     */
    private String approverRoleId;

    /**
     * 该节点实际审批人的角色名称
     */
    private String approverRoleName;

    /**
     * 审批结果展示名
     */
    private String approvalResultName;

    private String claimsId;


    public ApprRecordDTO(String nodeInstanceId, String nodeName, Integer completeFlag, String approvalResult, Date approvalDate, String suggestion, String remark, String nextNodeInstanceId, String approverId, String approverRoleId, String approverRoleName) {
        this.nodeInstanceId = nodeInstanceId;
        this.nodeName = nodeName;
//        this.completed = BooleanEnum.TRUE.getEnumCode().equals(completeFlag);
        this.approvalResult = approvalResult;
        this.approvalDate = approvalDate;
        this.suggestion = suggestion;
        this.remark = remark;
        //this.displayNo = displayNo;
        this.nextNodeInstanceId = nextNodeInstanceId;
        this.approverId = approverId;
        this.approverRoleId = approverRoleId;
        this.approverRoleName = approverRoleName;
    }
}
